﻿namespace AntdUI_HamburgerMenuTabs
{
    public class Models
    {
        /// <summary>
        /// 自定义 MenuItem 模型
        /// </summary>
        /// <param name="code"></param>
        /// <param name="name"></param>
        /// <param name="iconSvg"></param>
        public class MenuItem(string code, string name, string? iconSvg)
        {
            /// <summary>
            /// 菜单项唯一编码
            /// </summary>
            public string Code { get; set; } = code;

            /// <summary>
            /// 菜单项显示名称
            /// </summary>
            public string Name { get; set; } = name;

            /// <summary>
            /// Svg 图标
            /// </summary>
            public string? IconSvg { get; set; } = iconSvg;

            /// <summary>
            /// 菜单项绑定的用户控件 typeof(UserControl)
            /// </summary>
            public Type? PageType { get; set; }

            /// <summary>
            /// 是否允许关闭页面
            /// </summary>
            public bool Closeable { get; set; } = true;

            /// <summary>
            /// 子菜单集合
            /// </summary>
            public List<MenuItem> Sub { get; set; } = [];
        }

        /// <summary>
        /// MenuItem 自定义数据模型
        /// </summary>
        /// <param name="code"></param>
        public class MenuItemTag(string code)
        {
            /// <summary>
            /// 菜单编号
            /// </summary>
            public string Code { get; set; } = code;

            /// <summary>
            /// 菜单编号构成的路径
            /// </summary>
            public string? Path { get; set; }

            /// <summary>
            /// 菜单显示名称构成的路径
            /// </summary>
            public string? Path2 { get; set; }

            public AntdUI.MenuItem? Parent { get; set; }

            public Type? PageType { get; set; }

            /// <summary>
            /// 是否允许关闭页面
            /// </summary>
            public bool Closeable { get; set; } = true;
        }

        /// <summary>
        /// TabPage 自定义数据模型
        /// </summary>
        /// <param name="menuPath"></param>
        public class TabPageTag(string? menuPath)
        {
            /// <summary>
            /// 关联菜单路径
            /// </summary>
            public string? MenuPath { get; set; } = menuPath;

            /// <summary>
            /// 是否允许关闭页面
            /// </summary>
            public bool Closeable { get; set; } = true;
        }

        /// <summary>
        /// Page 自定义数据模型
        /// </summary>
        /// <param name="menuPath"></param>
        public class PageTag(string? menuPath)
        {
            /// <summary>
            /// 关联菜单路径
            /// </summary>
            public string? MenuPath { get; set; } = menuPath;
        }
    }
}